evaluate right side first, then remember the result as the value on the left side
in case of fractions always round down


1) p.atk = (buffed) attack power


2) if strong regular attack (not applicable to Lv1 tech)
	p.atk = p.atk * (135 + STR) / 128 + 6


3) damage = p.atk - defense


4) if critical hit (not applicable to Lv1 tech)
	4.a) damage = damage * (crit factor + weapon bonus + gear bonus) + crit bonus + (weapon bonus+1)/2
		crit factor:
			0 LUCK: 115%
			10 LUCK: 122%
			15 LUCK: 127%
			20 LUCK: 133%
			25 LUCK: 140%
			28 LUCK: 144%
			30 LUCK: 146%
			33 LUCK: 150%
		crit bonus:
			0 LUCK: 2
			10 LUCK: 23
			15 LUCK: 36
			20 LUCK: 51
			25 LUCK: 66
			28 LUCK: 75
			30 LUCK: 81
			33 LUCK: 90
		gear bonus:
			+15% Fencer's Armband
			+5% Dragon's Bone

	4.b) damage = damage * 125% if crit helm equipped


5) if Lv1 tech and damage > 1
	damage = damage * (tech factor + weapon bonus + counter bonus + gear counter bonus) + tech bonus
		tech factor:
			0 AGL: 110%
			10 AGL: 130%
			15 AGL: 140%
			20 AGL: 148%
			25 AGL: 156%
			28 AGL: 162%
			30 AGL: 166%
			33 AGL: 170%
		tech bonus:
			0 AGL: 0
			10 AGL: 16
			15 AGL: 22
			20 AGL: 30
			25 AGL: 40
			28 AGL: 46
			30 AGL: 50
			33 AGL: 56
		counter bonus:
			0 if not a counter attack
			otherwise value of weapon
		gear counter bonus:
			0 if not a counter attack
			counter helm: +25%
		monster bonus:
			0 if not a physical resistant/immune monster
			otherwise: +20%


6) power up/down buff on attacker
	damage = damage * 1.25 for buff
	damage = damage * 0.75 for debuff
	no change if both or neither


7) defense up/down buff on target
	damage = damage * 0.75 for buff
	damage = damage * 1.25 for debuff
	no change if both or neither


8) element of saber matches element of day
	damage x1.125


9) difficulty factor
	varies by character and difficulty, compare to player/enemy strength in the README

10) damage degradation for targetting high level monster
	100% vs players
	100% vs enemies Lv1-10
	47.31% vs enemies Lv99


11) physical resistance/weakness
	x1.00 if performing a counter attack
	x1.00 if equipped with Levatein tier weapon
	x1.50 damage for weakness
	x0.50 damage for resistance
	x0.25 damage for strong resistance
	x0.00 damage for immunity


12) elemental resistance/weakness based on active saber
	x1.50 damage for weakness
	x0.50 damage for resistance
	x0.25 damage for immunity
	add a copy of the damage but as healing for absorption
	add a copy of the damage targetted at the attacker in case of reflection
		if reflected AND the original target had Platinum Armor: x1.75 damage
		otherwise do not change damage


13) damage = damage/2


14) if Ragnarok is equipped and the attack was neither critical nor a Lv1 tech:
	damage = 1


15) cap at 999 damage


16) if Lv1 tech and successful counter attack and Fireblaze equipped:
	reduce target physical defense permanently
		-25% for regular enemies
		-STR/2 for bosses
		-1 for bosses that are "immune" to this effect